/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evangelion.core.daoImpl;

import com.evangelion.core.bean.Seccione;
import com.evangelion.core.bean.Vehiculo;
import com.evangelion.core.dao.VehiculoDao;
import java.util.List;
import javax.persistence.Query;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Usuario
 */
@Repository(value = "")
public class VehiculoDaoImpl extends GenericDaoImpl implements VehiculoDao {

    public List<Vehiculo> findListByParamSeccion(Seccione seccion, String parametro, String valor) {
        em = getEntityManager();
        Query q = em.createQuery("SELECT x FROM Vehiculo x where x.seccion=:seccion and x." + parametro + " like :valor");
        q.setParameter("valor", "%" + valor + "%");
        q.setParameter("seccion", seccion );
        return q.getResultList();


    }
}
